import 'package:app/page/ststem_pages/my_message.dart';
import 'package:app/widget/tap_appbar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/screenutil.dart';
class SystemPage extends StatefulWidget {
  @override
  _SystemPageState createState() => _SystemPageState();
}

class _SystemPageState extends State<SystemPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: TapAppBar(
          TapViewBar(
            Text("系统管理"),
          ),
          Size.fromHeight(ScreenUtil().setHeight(80))
      ),
      body: SingleChildScrollView(
        child: Column(
          children: <Widget>[
            InkWell(
              onTap: (){},
              child: getItem2("images/home/f3.gif", "我的系统管理"),
            ),
            SizedBox(height: ScreenUtil().setHeight(15),child: Container(
              color: Colors.black12,
            ),),
            InkWell(
                onTap: (){Navigator.of(context).push(MaterialPageRoute(builder: (context)=>MyMessage()));},
                child:getItem("images/home/f3.gif", "我的消息")
            ),
            SizedBox(height: ScreenUtil().setHeight(1),child: Container(
              margin: EdgeInsets.only(left: ScreenUtil().setSp(70)),
              color: Colors.black12,
            ),),
            InkWell(
                onTap: (){},
                child:getItem("images/home/f3.gif", "工程查询")
            ),
            SizedBox(height: ScreenUtil().setHeight(15),child: Container(
              color: Colors.black12,
            ),),
            InkWell(
                onTap: (){},
                child:getItem("images/home/f3.gif", "工程查询")
            ),
            SizedBox(height: ScreenUtil().setHeight(15),child: Container(
              color: Colors.black12,
            )),
            InkWell(
                onTap: (){},
                child:getItem("images/home/f3.gif", "工程查询")
            ),
            SizedBox(height: ScreenUtil().setHeight(1),child: Container(
              margin: EdgeInsets.only(left: ScreenUtil().setSp(70)),
              color: Colors.black12,
            ),),
            InkWell(
                onTap: (){},
                child:getItem("images/home/f3.gif", "工程查询")
            ),
            SizedBox(height: ScreenUtil().setHeight(1),child: Container(
              margin: EdgeInsets.only(left: ScreenUtil().setSp(70)),
              color: Colors.black12,
            ),),
            InkWell(
                onTap: (){},
                child:getItem("images/home/f3.gif", "工程查询")
            ),
            SizedBox(height: ScreenUtil().setHeight(1),child: Container(
              margin: EdgeInsets.only(left: ScreenUtil().setSp(70)),
              color: Colors.black12,
            ),),
            InkWell(
                onTap: (){},
                child:getItem("images/home/f3.gif", "工程查询")
            ),
            SizedBox(height: ScreenUtil().setHeight(1),child: Container(
              margin: EdgeInsets.only(left: ScreenUtil().setSp(70)),
              color: Colors.black12,
            ),),
            InkWell(
                onTap: (){},
                child:getItem("images/home/f3.gif", "工程查询")
            ),
            SizedBox(height: ScreenUtil().setHeight(15),child: Container(
              color: Colors.black12,
            )),
            //      getItem(icon, title),getItem(icon, title),getItem(icon, title),getItem(icon, title),
            InkWell(
              onTap: (){},
              child: Container(
                height: ScreenUtil().setHeight(100),
                alignment: Alignment.center,
                child: Text("退出登陆",style: TextStyle(fontSize: ScreenUtil().setSp(30)),),
              ),
            )

          ],
        ),
      )
    );
  }
  Widget getItem(String icon,String title){
    return Container(
      alignment: Alignment.center,
      height: ScreenUtil().setHeight(120),
      margin: EdgeInsets.only(left: 50),
//      decoration: BoxDecoration(
//          border: Border(bottom:BorderSide(
//              width: 1,color: Colors.black12
//          ))
//      ),
      child: ListTile(
        leading: Image.asset(icon),
        title: Text(title),
        trailing: IconButton(icon: Icon(Icons.arrow_forward_ios), onPressed: null),
      ),
    );
  }
  Widget getItem2(String icon,String title){
    return Container(
      alignment: Alignment.center,
      height: ScreenUtil().setHeight(120),
      margin: EdgeInsets.only(left: 50),
//      decoration: BoxDecoration(
//          border: Border(bottom:BorderSide(
//              width: 1,color: Colors.black12
//          ))
//      ),
      child: ListTile(
        leading: Image.asset(icon),
        title: Text(title),
        trailing:Container(
          alignment: Alignment.centerRight,
          width: ScreenUtil().setWidth(130),
          child:  Row(
            children: <Widget>[
              Text("进入系统",style: TextStyle(color: Colors.redAccent),),
              IconButton(icon: Icon(Icons.arrow_forward_ios), onPressed: null)
            ],
          ),
        )
      ),
    );
  }
}
